//
//  Untitled.swift
//  SlaughterClient
//
//  Created by 邱仙凯 on 2025/1/8.
//  Copyright © 2025 zwb. All rights reserved.
//

import Foundation
import ObjectMapper

public class BaseFormModel: Mappable {
    
    // MARK: Declaration for string constants to be used to decode and also serialize.
    private struct SerializationKeys {
       
        
        static let zParallel = "z_parallel"
        static let zIfOvertime = "z_if_overtime"
        static let zOvertimeNum = "z_overtime_num"
        static let zOvertimeTime = "z_overtime_time"
        static let zOvertimedNum = "z_overtimed_num"
    }
//    z_if_overtime:是否支持加时;
//    z_overtime_num: 加时次数限制;
//    z_overtime_time: 加时时间(秒);
//    z_overtimed_num: 已加时次数;
//    z_end_date:结束时间
    public var zParallel:String?
    public var zIfOvertime: String?
    public var zOvertimeNum: String?
    public var zOvertimeTime: String?
    public var zOvertimedNum: String?
    // MARK: ObjectMapper Initializers
    /// Map a JSON object to this class using ObjectMapper.
    ///
    /// - parameter map: A mapping from ObjectMapper.
    public required init?(map: Map){
        
    }
    
    /// Map a JSON object to this class using ObjectMapper.
    ///
    /// - parameter map: A mapping from ObjectMapper.
    public func mapping(map: Map) {
        
        zParallel <- map[SerializationKeys.zParallel]
        zIfOvertime <- (map[SerializationKeys.zIfOvertime],StringTransform())
        zOvertimeNum <- (map[SerializationKeys.zOvertimeNum],StringTransform())
        zOvertimeTime <- (map[SerializationKeys.zOvertimeTime],StringTransform())
        zOvertimedNum <- (map[SerializationKeys.zOvertimedNum],StringTransform())
      
    }
    
    /// Generates description of the object in the form of a NSDictionary.
    ///
    /// - returns: A Key value pair containing all valid values in the object.
    public func dictionaryRepresentation() -> [String: Any] {
        var dictionary: [String: Any] = [:]
        if let value = zParallel { dictionary[SerializationKeys.zParallel] = value }
        if let value = zIfOvertime { dictionary[SerializationKeys.zIfOvertime] = value }
        if let value = zOvertimeNum { dictionary[SerializationKeys.zOvertimeNum] = value }
        if let value = zOvertimeTime { dictionary[SerializationKeys.zOvertimeTime] = value }
        if let value = zOvertimedNum { dictionary[SerializationKeys.zOvertimedNum] = value }

        return dictionary
    }
    
}

